/**
 * 
 */
package cardval.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

/** 
 * @Description: 
 * @author Renne66
 * @email 465119455@qq.com
 * @date 2016年4月24日 
*/
public class DateUtil {
	
	public final static String YYYY = "yyyy";
	public final static String YYYYMMDD = "yyyyMMdd";
	public final static String YYYY_MM_DD = "yyyy-MM-dd";
	public final static String MMDDHHMMSS = "MMddHHmmss";
	public final static String YYYYMMDDHHMMSS = "yyyyMMddHHmmss";
	public final static String YYYY_MM_DD_HH_MM_SS = "yyyy-MM-dd HH:mm:ss";
	public final static String YYYY_MM_DD_HH_MM_SS_MS = "yyyy-MM-dd HH:mm:ss.SSS";

	public static String formatNow(String pattern) {
		SimpleDateFormat sdf = new SimpleDateFormat(pattern);
		return sdf.format(new Date());
	}

	public static String format(Date date, String pattern) {
		return new SimpleDateFormat(pattern).format(date);
	}

	public static Date time(String time, String type) throws ParseException {
		return new SimpleDateFormat(type).parse(time);
	}
	

	/**
	 * @return
	 */
	public static Date getCurDate() {
		return new Date();
	}

}
